package test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import movement.Location;

import org.junit.Before;
import org.junit.Test;

import dispatch.DispatchCenter;
import emergency.*;
import emergency.Fire.Size;

public class useCaseTestCancelEmergency {
	private Emergency fire;
	private DispatchCenter center;
	// chain of res.
	private RequirementsEmergency startOfRequirementsChain;

	@Test
	public void cancelEmergency(){
		assertEquals(fire.getStateName(),"staterecorded");
		assertTrue(center.getEmergencyboard().getEmergencies().contains(fire));
		fire.cancelEmergency();
		assertEquals(fire.getStateName(),"statecanceled");
		assertTrue(center.getEmergencyboard().getEmergencies().contains(fire));
		assertTrue(center.getEmergencyboard().getEmergenciesCancelled().contains(fire));
	}

	public RequirementsEmergency getStartOfRequirementsChain() {
		return startOfRequirementsChain;
	}
	@Before
	public void setUp() throws Exception {
		center = new DispatchCenter("DC 1", new Location(45, 45,
				"DC 1 - Location"), new Location(60, 60, "GarageLocation"));
		
		fire = new Fire(new Location(10, 10, "Foch"), Severity.BENIGN, center,
				Size.LOCAL, true, 5, 5);
	}
}
